package cn.iocoder.yudao.module.leverage.enums;

import cn.hutool.core.util.EnumUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@Getter
@AllArgsConstructor

public enum OrderDirectionEnum {
    BUY(1, "买入"),
    SELL(2, "卖出");

    private final Integer type;

    private final String title;

    public static OrderDirectionEnum getByType(Integer type) {
        return EnumUtil.getBy(OrderDirectionEnum.class,
                e -> Objects.equals(type, e.getType()));
    }
}
